home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_gs / BIN / PS2PDF < prev    next >
Text File  |  1999-09-17  |  616b  |  34 lines

  1. #!/bin/sh
  2. # Convert PostScript to PDF.
  3.  
  4. OPTIONS=""
  5. while true
  6. do
  7.     case "$1" in
  8.     -*) OPTIONS="$OPTIONS $1" ;;
  9.     *)  break ;;
  10.     esac
  11.     shift
  12. done
  13.  
  14. if [ $# -lt 1 -o $# -gt 2 ]; then
  15.     echo "Usage: `basename $0` [options...] input.ps [output.pdf]" 1>&2
  16.     exit 1
  17. fi
  18.  
  19. infile=$1;
  20.  
  21. if [ $# -eq 1 ]
  22. then
  23.     case "${infile}" in
  24.       *.ps)        base=`basename ${infile} .ps` ;;
  25.       *)        base=`basename ${infile}` ;;
  26.     esac
  27.     outfile=${base}.pdf
  28. else
  29.     outfile=$2
  30. fi
  31.  
  32. # Doing an initial 'save' helps keep fonts from being flushed between pages.
  33. exec gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfile $OPTIONS -c save pop -f $infile
  34.